<?php

//处理提交数据

require "database.php";

$__f__=file_get_contents("demo.json");
$__f__=json_decode($__f__,1);
$posts=$_POST;

// $____betting____=$__f__["betting"];

$__f__["threshold"] =(int)$posts["threshold"];
$__f__["repet"]     =(int)$posts["repet"];
$__f__["limitless"] =(int)$posts["limitless"];
$__f__["yssyt"]     =(int)$posts["yssyt"];	
$__f__["yskst"]     =(int)$posts["yskst"];
$__f__["ztze"]      =(int)$posts["ztze"];
$__f__["zyk"]       =(int)$posts["zyk"];
$__f__["starttime"] =$posts["starttime"];
$__f__["stopTime"]  =$posts["stopTime"];

// $p=1;
// for ($i = 0; $i < count($____betting____); $i++) {
//     if($____betting____[$i]["id"] && array_key_exists("bj".$p,$posts)){
//         $____betting____[$i]["bj"]=$posts["bj".$p];
//         $____betting____[$i]["size"]=$posts["size".$p];
//         $____betting____[$i]["single_and_double"]=$posts["single_and_double".$p];
//         $____betting____[$i]["dragon_and_tiger"]=$posts["dragon_and_tiger".$p];
//         $____betting____[$i]["track"]=$posts["track".$p];
//         $____betting____[$i]["sleep"]=$posts["sleep".$p];
//         $____betting____[$i]["status"]=$posts["status".$p];
//     }
//     $p++;
// }
	
// $__f__["betting"]=$____betting____;



$c=file_put_contents("demo.json",json_encode($__f__,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE));
if($c){
    return json([
        "code"=>200,
        "msg"=>"successful"
    ]);
}



